Spoj Problem pages:

List of problems:

  1. Convert an infix notation to reverse polish notation.
  2. Find the next bigger palindrome of a number.
  3. Coin-change problems.
    1. Find the number of ways a change can be made using a given denominations of currencies.
    2. Find the least number of coins required to make a change given a few denominations.
    3. Find a change such that no denomination is repeated.
  4. Significance of Pascals Identity
    1. nCr = (n-1)Cr +(n-1)C(r-1)
  5. Print all the anagrams together for a given number of words
  6. Union-find
    1. Dynamic connectivity problems.
      1. Quick-find
      2. Quick-union
      3. Weighted quick-union
      4. Path compression with weighted quick-union
  7. Add two numbers represented by a linked list.
  8. Reservoir sampling.
    1. Given an array of numbers, WAP to randomly select k numbers 1<=k<=n.
  9. Generate all permutations of a f=given array of values.
  10. Convert a number from base 2 to base 4,8,16 ......
  11. Given sorted circular linked list. Insert an element.
  12. Given two BSTs. Print all the common elements.
  13. Find if a binary tree is balanced.
  14. Remove duplicate elements from a string in O(n) time and O(1) space.
  15. Merge two sorted arrays into a single sorted array.
  16. Given an array, find all pairs whose sum is k.
  17. Find all pairs whose sum is >=k.
  18. Given an array find the maximum contiguous sub-array with maximum.
  19. Find LCA of two nodes in a BST.
  20. Given a sorted array which has been rotated an unknown number of times. Find the smallest element in O(log n) time.
  21. Box stacking.
    1. Given n boxes. Find the stack of maximum height such that length and breadth of any lower box is bigger than a given box in the stack.
  22. Longest increasing sub-sequence in an array.




  23. Union-find
    1. Dynamic connectivity problems.






  24. Union-find problem